package controllers

import (
	"fmt"

	"git.oschina.net/zzx2010/go/mybee/models"
	"github.com/astaxie/beego"
)

type AddController struct {
	beego.Controller
}

func (c *AddController) Get() {
	c.Data["Name"] = "名称"
	c.Data["Url"] = "网址"
	c.Data["Account"] = "账号"
	c.Data["PWD"] = "密码"
	c.TplName = "add.html"
}

func (c *AddController) Post() {
	var item models.Item
	c.ParseForm(&item)

	fmt.Println(item)

	models.AddItem(item)
	c.Ctx.WriteString(item.Name)

}
